package com.example.saas.controller;

import com.example.saas.domain.User;
import com.example.saas.service.UserServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final UserServiceImpl userService;

    @PostMapping("/list")
    public ResponseEntity<Object> list(){
        List<User> list = userService.list();
        return ResponseEntity.ok(list);
    }
}
